package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.BmsParkingPaymentRecords;
import com.macro.mall.portal.service.BmsParkingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 停车缴费
 * Created by macro on 2018/4/26.
 */
@Controller
@Api(tags = "bmsParkingController")
@Tag(name = "bmsParkingController", description = "停车缴费表")
@RequestMapping("/bmsParking")
public class BmsParkingController {
    @Autowired
    private BmsParkingService bmsParkingService;

    @ApiOperation("停车缴费记录查询")
    @RequestMapping(value = "/getParkingList", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<CommonPage<BmsParkingPaymentRecords>> getParkingList(
            @RequestBody BmsParkingPaymentRecords bmsParkingPaymentRecords,
            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        List<BmsParkingPaymentRecords> bmsParkingPaymentRecordsList = bmsParkingService.getParkingList(bmsParkingPaymentRecords,pageSize,pageNum);
        return CommonResult.success(CommonPage.restPage(bmsParkingPaymentRecordsList));
    }

}
